package com.six.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.HashMap;
import java.util.List;

@Mapper
public interface ChartMapper {
    //负责查询每个供应商提供的商品数量
    @Select("select a.supplyname,sum(a.quantity)as sum ,b.pname \n" +
            "from supply a,product b \n" +
            "where a.pid=b.pid \n" +
            "group by a.pid")

    public List<HashMap> chartA();

    @Select("select a.supplyname, a.quantity as sum ,b.pname\n" +
            "from supply a,product b\n" +
            "where a.pid=b.pid \n" +
            "order by a.supplyname")
    public List<HashMap> chartB();


}
